1 Gourmet Coffee 23skidoo These handy blocks of information will help you explore the many different parts of the Visual Basic Scripting language. You'll find all the parts of the VBScript language listed alphabetically under the Alphabetic Keyword List. But if you want to examine just one category, say, objects, each language category has its own, more compact section. How's it work? Click on one of the headings to the left to display a list of items contained in that category. From this list, select the topic that you want to view. Once you've opened that topic, you can easily link to other related sections. So, go ahead and take a look! Study some statements, mull over the methods, or figure out a few functions. You'll see just how versatile the VBScript language can be! 85 85.99 85.99 2/2/98 15:55:34 3 Monday state s4 enter name error in department name enter description error in department description enter password password must be at least 3 characters in length enter tag number (1.1) tag number must be a whole number between (100) and 100 inclusive (1.1) enter percent off percent off must be a decimal number between (5) and 100 inclusive enter price list price must be a US currency value between 0.01 and 999 inclusive enter date start date must be in the format mm/dd/yyyy and between 12/1/1975 and 1/12/2012 choose day of the week browse for a day of the week site term Day of week error
Last updated on 5/15/01

EditField Widget

/widgets/editHTC/editfield.htc

The EditField is a self-validating control that can be used within an EditSheet or alone on a page. It supports a wide number of data types:

(true|false)      d = dirty      r = required      v = valid
Boolean
loading property...
d
Text:
 Short/Long/
loading property...
d
r
v
loading property...
d
r
v
Text:
 Password
loading property...
d
r
v
Numeric:
 Integer/Float/
loading property...
d
r
v
loading property...
d
r
v
 Currency
loading property...
d
r
v
Date/Time
loading property...
d
r
v
loading property...
d
r
v
Select/browse (text)
loading property...
d
v
loading property...
d
r
v
Linked select
loading property...
d
v
loading property...
d
v

Test:

Site Term Value Picker dialog (from browse control) returns:


Field types supported

type subtype description
Boolean none This is a checkbox field that will always return either 1 (checked) or 0 for it's value.
date none This is a short text field with "6" button to the right. This button opens the calendar control in a drop-down picker. It displays the short form of the date (mm/dd/yyyy).  A default format is used to enforce this format if the meta-xml does not contain a value for <format>. The default format for date is mm/dd/yyyy
time none This displays the time in a short 24 hour format of "hh:mm".
text short displays a single line (does not allow carriage returns). A default charmask is used to enforce this format if the meta-xml does not contain a value for <charmask>. The default regular expression representing short text is ^[^<>&]*$
text long displays four lines (scrollable) in a control that allows carriage returns. A default charmask is used to enforce this format if the meta-xml does not contain a value for <charmask>. The default regular expression representing long text is ^[^<>&]*$
text password displays same as text/short but uses a password INPUT type: a single line (does not allow carriage returns). A default charmask is used to enforce this format if the meta-xml does not contain a value for <charmask>. The default regular expression representing short text is ^[^<>&]*$
numeric currency This displays the number passed into the control as a currency value. A default format is used to enforce this format if the meta-xml does not contain a value for <format>. The default format representing currency is -1.1
numeric float Displays only numbers and a decimal point. A default format is used to enforce this format if the meta-xml does not contain a value for <format>. The default format representing floats is -1.1
numeric integer Displays only integers.  A default charmask is used to enforce this format if the meta-xml does not contain a value for <format>. The default format representing integers is -1.1
select none This is a list picker like the HTML SELECT. You can only pick from this list. Unlike the HTML select options may contain HTML like IMG tags and B or I formatting tags if htmloptions='yes'.

events

onError
fires on error (when m_bDebug = true in HTC, shows alert as well)

event object properties

window.event.error String. Returns error detail.

onBeginChange
fires immediately every time the control value is changed.
onChange
fires when control value is changed and the field looses focus.
onRequire
fires when required status changes

event object properties

window.event.required Boolean. Returns true if field is marked as required and is currently empty, false otherwise

onValid
fires when valid status changes

event object properties

window.event.valid Boolean. Returns true if field is is currently valid, false otherwise

onBrowse
Only fired for fields where @onbrowse or @browse is set: fired when browse ellipsis (...) button clicked.

event object properties

window.event.value Boolean. Returns field value.

methods

elEditField.focus()
sets focus to the control (if control not disabled) and selects contents (exceptions: Select control sets focus on button and does not select contents. Any control that has a read-only browse button works similarly)

parameters

none

return value

none

elEditField.resetDefault()
resets subcontrol value to the default set for the control, or an empty string if no default set

parameters

none

return value

none

efSelect.reload(sID)
Select control only: reloads control menu items using the original MetaXML data island and the new sID provided

parameters

sID Required. ID of field in meta-xml.

return value

none

remarks

Used to reload a different list in a select list picker.

efSelect.addItem(sValue, sDIsplayValue)
Select control only: adds a new menu item to picker

parameters

sValue Required. underlying value for new item.

sDIsplayValue Required. display value for new item.

return value

none

efSelect.removeItem(sValue)
Select control only: removes a menu item from picker

parameters

sValue Required. underlying value for item to be removed.

return value

none

container attributes (set on element using EditField behavior)

DataXML xml data (from a recordset) data-island id. Usually in the format:
	<document>
		<record>
			<fieldId1>fieldValue1</fieldId1>
			<fieldId2>fieldValue2</fieldId2>
			...
		</record>
		...
	</document>
MetaXML xml meta-data data-island id
ID id matching the field id in the meta-xml for this field

scriptable properties

bValue = elEditField.dirty
Read-only. Returns true if the control's value has been changed, false otherwise.
bValue = elEditField.disabled
elEditField.disabled = bValue
Read-write. Returns true if the field is disabled (grayed-out, button and text input disabled), false otherwise.
bValue = elEditField.readonly
elEditField.readonly = bValue
Read-write. Returns true if the field is readonly (not 3D, button removed), false otherwise.
bValue = elEditField.required
Read-only. Returns true if the field is required and currently has no value, false otherwise. OnRequire event fires when this value changes.
bValue = elEditField.valid
Read-only. Returns true if the field is currently valid, false otherwise. OnValid event fires when this value changes.
bValue = elEditField.prompt
elEditField.prompt = bValue
Read-write. Sets or returns the prompt that will display when the control is empty. Select control only shows prompt if value is not equal to any of the options.
sValue = elEditField.value
elEditField.value = sValue
Read-write. Returns the value contained in the field. OnChange event fires when this value changes. Cannot be set when contol is disabled. (Exception: Browse control value can be set if ellipsis (...) button has been enabled using @browsereadonly)
sValue = elSelect.displayvalue
Select control only: Read-only. Returns the display value for current value.
set elOptions = elSelect.options
Select control only: Read-only. Returns a collection of the option elements (DIVs) for the select's list of options.
set elOption = elSelect.selected
Select control only: Read-only. Returns the option element (DIV) currently selected from the select's list of options.

meta-xml

KEY:     <NodeTag>     <RepeatingNodeTag*>     @attribute

sample

<xml id='esMeta'>
  <editfield>
	<text id='dept_name' required='yes' maxlen='50' default='1' onchange='doOnChange()'>
	  <prompt>&lt;enter name&gt;</prompt>
	</text>
	<select id='dept_id'>
	  <select id='dept_id'>
		<option value='1'>department 1</option>
		<option value='2'>department 2</option>
		<option value='3'>department 3</option>
		<option value='4'>department 4</option>
		<option value='5'>department 5</option>
		<option value='6'>department 6</option>
		<option value='7'>department 7</option>
		<option value='8'>department 8</option>
		<option value='9'>department 9</option>
	  </select>
	</select>
  </editfield>
</xml>